package com.example.curriculum;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
//数据库基本类表
public class DatabaseHelper extends SQLiteOpenHelper {

    public DatabaseHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }


    //创建数据库
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table courses(" +
                "id integer primary key autoincrement," +//逐渐且自动增长
                "name text," +
                "teacher text," +
                "room text," +
                "day integer," +
                "start integer," +
                "cend integer)");
        db.execSQL("create table user(" +
                "id integer primary key autoincrement," +//逐渐且自动增长
                "name text," +
                "password text)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
